#include <iostream>

using std::cout;
using std::endl;

int sum()
{
    return 0;
}

//1 ---- n - 1
template <typename T, typename ...Args>
int sum(T t, Args ...args)
{
    return  t + sum(args...);//递归的操作
}

void test()
{
    //想计算1 + 2 + ... + 10
    cout << "sum(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) = "
        << sum(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) << endl;
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

